package com.ketai.appinfo.service;

import com.ketai.appinfo.mapper.BackendUserMapper;
import com.ketai.appinfo.pojo.BackendUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;

/**
*@Author 刘玉琼
*@Time 2020-11-03
*
*/
@Service
@Transactional
public class BackendUserService{

    @Resource
    private BackendUserMapper backendUserMapper;

    public BackendUser backUserLogin(String userCode, String userPassword) {
        if(StringUtils.isEmpty(userCode)){
            return null;
        }
        BackendUser user=backendUserMapper.backUserLogin(userCode);
        if(user==null){
            return  null;
        }
        //判断角色
        //判断密码
        if(!userPassword.equals(user.getUserpassword())){
            return  null;
        }
        return user;
    }
}
